@echo off
echo Building VC++2005 DevOps Platform (Fixed)...

call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86

if not exist build mkdir build

echo Step 1: Compiling fixed version...
cl.exe /nologo /c /MT /O2 /DNDEBUG /EHsc /Isrc /Fobuild\main_fixed.obj src\main-final-fixed.cpp

if %errorlevel% neq 0 (
    echo Compilation failed!
    exit /b 1
)

echo Step 2: Linking executable...
link.exe /nologo /OUT:build\DevOpsPlatform-fixed.exe build\main_fixed.obj kernel32.lib user32.lib

if %errorlevel% equ 0 (
    echo Build successful!
    build\DevOpsPlatform-fixed.exe status
) else (
    echo Linking failed!
    exit /b 1
)
